package com.server.questionbank.snframe.config.filter;

import java.util.HashSet;
import java.util.Set;

import lombok.Data;

@Data
public class AllowedOrigninsBean {
    private Set<String> orignin;

    public void addOne(String url) {
        if (this.getOrignin() == null) {
            this.orignin = new HashSet<>();
        }
        this.getOrignin().add(url);
    }

    public void addInBatch(String urls) {
        String[] origins = urls.split("[,，;；]");
        addInBatch(origins);
    }

    public void addInBatch(String[] urls) {
        for (String one : urls) {
            this.addOne(one);
        }
    }
}
